package com.baizan.daka.rx.Subscriber

import com.baizan.daka.Constants
import com.baizan.daka.MyApp
import com.baizan.daka.showToast
import com.baizan.daka.ui.activity.LoginActivity
import com.baizan.daka.util.Preference
import io.reactivex.disposables.CompositeDisposable

 abstract class CommonSubscriber<T>(
    mCompositeSubscription: CompositeDisposable?
) : BaseSubscriber<T>(mCompositeSubscription) {

    abstract override fun onCallNext(t: T?)

    override fun onCallCompleted() {

    }

    override fun onCallError(e: String) {
    }

    override fun onCallLogin(error: String) {
        var isLogin: Boolean by Preference(Constants.ISLOGIN, false)
        isLogin = false
        MyApp.clearnAll(null)
        showToast(error)
        LoginActivity.start(MyApp.instance)
    }


}